package com.flying.acls.model.jdbc;

import com.flying.acls.model.ResExpr;
import com.flying.acls.model.ResExpr;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;

import java.util.List;

public interface ResExprRepository extends JpaRepository<ResExpr, Long>, QuerydslPredicateExecutor<ResExpr> {
    @Secured("ROLE_ADMIN")
    ResExpr findTopById(Long id);

    @PreAuthorize("authenticated")
    List<ResExpr> findAll();
}
